-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clamav prescan #389
Clamav prescan #389
Conversation
aspacca
commented
Jul 18, 2021
- option to prescan with clamav before upload (rejecting if positive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw we have used the int status code in various places, so not the biggest need to change those.
But from what i can see the actual scanning would void the data and the actual backend upload should not get any data.
3397132
to
58433a4
Compare
I'll review/test this tomorrow 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall worked fine for me, just a couple of small changes.
For bigger files the upload also seems to "hang" while the prescan is ongoing. Should we add something to the web interface that shows this "step"? |
I haven't tested on UI, I will check. The main problem is due to clamd limits: |
I'll configured clamd for 4G files. Something i was thinking of was is splitting the temp files. I need to test if that works for a single binary thats malicious getting split up into say 4 smaller files and then scanned in parallel. In practice i would assume finding the same matches, but statistically, i might split the malicious code apart not letting clamd recognize it. I wonder if for the UI we can simply adjust the progress bar. |
I think that splitting the file could lead to false negative. |
I need to dive into that frontend code to look further, but yeah unlikely an easy way. |
@aspacca Lets get this pushed along and limit file size scan limit to something like 1G for now. It is better than nothing 👍 |
@stefanbenten I wanted to refactor this PR in order to allow both also setting automatically the file limit in transfer.sh if the prescan is enabled |
58433a4
to
c05990b
Compare
c05990b
to
c3b3bbe
Compare
@stefanbenten feel free to merge after testing |
Thanks, will push the linting fixes as well after testing! |
I did the linting |
for me it is good to merge, I will later refine something around |
Thanks for pushing this up. I'll give it a go in a bit 👍 |
Working like a charm! Thanks again @aspacca ! |
let's wait to make a release when I'll add back support for clamav on the network :) |
This change along with missing ( I could trace this back to the newest commit and this PR. It seems that setting either Aside: While looking up the command arguments, I also noticed that, on the dockerhub site, My setup is pretty simple btw: Just a local file provider with a mounted volume for the files. Also needed to add a volume EDIT: If interested, here is my current docker-compose file. The changes I made today where adding the |
@LinusCDE unfortunately we cannot garantuee issues like this to happen on main branch and docker images based on main branch. You must consider main as unstable The problem is here: https://github.com/dutchcoders/transfer.sh/pull/459/files#diff-8e494a434a8037b6c0b888e25b2baae7618fe65e792d4a155dadd096e9350667L396: fixed on #460 |
the readme on docker hub has to be updated manually unluckily, but I see the missing env for as for @LinusCDE do you mind opening two issues for the above? thanks :) |
I can understand this way of thinking. However I intuitively thought the other way. Since some consider latest/main/master stable (having a dev branch or unstable builds) it can usually either be "stable" or "unstable". Seeing that on dockerhub, there are two "unstable" tags ("unstable" and "edge") and no explicit latest stable ones like "stable" "v1" or "1", I assumed latest to be the stable one. Even though latest gets updated daily, I just thought, this would be because the build is scheduled daily. Should I create an issue as well for this? Since I have auto-updating and there is no tag for the latest stable release, this would force me update the tag manually for each release and at sometime forget about this and let the version rot. I use watchtower to keep my containers/services up-to-date and usually try to make it target the latest stable branch (preferably of the current major version like "1", so I still need to address breaking changes manually). |
@aspacca Do you mean that there is no tag that can be used to pull the current stable release? |
We probably could make a |
That sounds great! |
In the end I personally agree with https://vsupalov.com/docker-latest-tag/, as long as we talk about production environment. Anyway, let's add a |
On production, where people are paid to monitor their deployment this makes sense. But not when I'm having dozens of containers, that either update automatically or get forgotten. Also production seems to usually have a host of other problems (namely having own up to date builds and not waiting on a dependency chain to fix CVEs). So they will most likely create their own containers anyway, and this is what it seems to target. |